#df是对象中 loc属性 & iloc属性
import pandas as pd
# 解决数据输出时列名不对齐问题
pd.set_option('display.unicode.east_asian_width',True)
data = [[102,345,657],[768,888,990],[12,38,466],[662,384,766],[454,787]]
name = ['jack','rose','zs','ls','dark']
columns = ['java','python','c++']
df = pd.DataFrame(data=data , index=name,columns=columns)
# print(df.loc['jack'])
# print(df.loc[['jack','zs']])
# print(df.loc['jack':'zs'])
# print(df.loc[:'ls':2])
# print(df.iloc[0:3])
# print(df.iloc[1::2])
# print(df[['java','python']])
# print(df.iloc[:,[0,1]])
print(df.iloc[:,:1])
# () & () 并列条件
print(df.loc[(df['python'] > 105) & (df['c++'] > 600)])
